<template>
    <div class="data-content">
        <div class="company-right" v-if="(corpType == '施工' || corpType == '勘察设计') && !!jtqiyeInfo.corpName">
            <table class="layui-table">
                <colgroup>
                    <col width="200">
                    <col width="200">
                    <col width="200">
                    <col width="200">
                </colgroup>
                <thead>
                    <tr>
                        <th colspan="4">基本信息</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <th>企业名称</th>
                        <td colspan="3" style="text-align: left">{{jtqiyeInfo.corpName}}</td>
                    </tr>
                    <tr>
                        <th>注册省份</th>
                        <td>{{jtqiyeInfo.regProvinceCode}}</td>
                        <th>注册城市</th>
                        <td>{{jtqiyeInfo.regCityCode}}</td>
                    </tr>
                    <tr>
                        <th>曾用名</th>
                        <td>{{jtqiyeInfo.corpUseName}}</td>
                        <th>行政主管部门</th>
                        <td>{{jtqiyeInfo.chargeDepartment}}</td>
                    </tr>
                    <tr>
                        <th>营业执照注册号</th>
                        <td>{{jtqiyeInfo.businessLicence}}</td>
                        <th>注册资金(万元)</th>
                        <td>{{jtqiyeInfo.regFund}}</td>
                    </tr>
                    <tr>
                        <th>企业类型</th>
                        <td>{{jtqiyeInfo.corpType}}</td>
                        <th>企业性质</th>
                        <td>{{jtqiyeInfo.natureType}}</td>
                    </tr>
                    <tr>
                        <th>营业执照注册日期</th>
                        <td>{{jtqiyeInfo.regDate}}</td>
                        <th>成立日期</th>
                        <td>{{jtqiyeInfo.buildDate}}</td>
                    </tr>
                    <tr>
                        <th>法定代表人</th>
                        <td>{{jtqiyeInfo.legalRepresentative}}</td>
                        <th>法定代表人职称</th>
                        <td>{{jtqiyeInfo.artificialpersonTitle}}</td>
                    </tr>
                    <tr>
                        <th>企业负责人</th>
                        <td>{{jtqiyeInfo.enterpriseLeader}}</td>
                        <th>企业负责人职称</th>
                        <td>{{jtqiyeInfo.leaderTitle}}</td>
                    </tr>
                    <tr>
                        <th>技术负责人</th>
                        <td>{{jtqiyeInfo.technicalLeader}}</td>
                        <th>技术负责人职称</th>
                        <td>{{jtqiyeInfo.technicalLeaderDuty}}</td>
                    </tr>
                    <tr>
                        <th>营业范围</th>
                        <td colspan="3" style="text-align: left">{{jtqiyeInfo.businessScope}}</td>
                    </tr>
                    <tr>
                        <th>资产构成情况及投资关联企业情况</th>
                        <td colspan="3" style="text-align: left">{{jtqiyeInfo.assetsInvestment}}</td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="company-right" v-if="corpType == '监理' && !!jtqiyeInfo.corpName">
            <table class="layui-table">
                <colgroup>
                    <col width="200">
                    <col width="200">
                    <col width="200">
                    <col width="200">
                </colgroup>
                <thead>
                    <tr>
                        <th colspan="4">基本信息</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <th>企业名称</th>
                        <td colspan="3" style="text-align: left">{{jtqiyeInfo.corpName}}</td>
                    </tr>
                    <tr>
                        <th>企业性质</th>
                        <td>{{jtqiyeInfo.natureType}}</td>
                        <th>企业类型</th>
                        <td>{{jtqiyeInfo.corpType}}</td>
                    </tr>
                    <tr>
                        <th>公司负责人</th>
                        <td>{{jtqiyeInfo.enterpriseLeader}}</td>
                        <th>技术负责人</th>
                        <td>{{jtqiyeInfo.technicalLeader}}</td>
                    </tr>
                    <tr>
                        <th>营业执照号注册号</th>
                        <td>{{jtqiyeInfo.businessLicence}}</td>
                        <th rowspan="6">营业执照照片</th>
                        <td rowspan="6"><img style="width: 150px; height: 150px" src="http://glxy.mot.gov.cn:9000/mobile/pluginnew/Download.jsp?url=c6f5115c0cfb462f8bce340eacd668a8"/></td>
                    </tr>
                    <tr>
                        <th>注册日期</th>
                        <td>{{jtqiyeInfo.regDate}}</td>
                    </tr>
                    <tr>
                        <th>成立时间</th>
                        <td>{{jtqiyeInfo.buildDate}}</td>
                    </tr>
                    <tr>
                        <th>营业执照有效至</th>
                        <td>{{jtqiyeInfo.effectDate}}</td>
                    </tr>
                    <tr>
                        <th>注册资本（万元）</th>
                        <td>{{jtqiyeInfo.regFund}}</td>
                    </tr>
                    <tr>
                        <th>法定代表人</th>
                        <td>{{jtqiyeInfo.legalRepresentative}}</td>
                    </tr>
                    <tr>
                        <th>联系电话</th>
                        <td>{{jtqiyeInfo.tel}}</td>
                        <th>电子邮箱</th>
                        <td>{{jtqiyeInfo.contactEMail}}</td>
                    </tr>
                    <tr>
                        <th>企业传真</th>
                        <td>{{jtqiyeInfo.fax}}</td>
                        <th>网址</th>
                        <td>{{jtqiyeInfo.website}}</td>
                    </tr>
                    <tr>
                        <th>邮编</th>
                        <td colspan="3" style="text-align: left">{{jtqiyeInfo.cityPost}}</td>
                    </tr>
                    <tr>
                        <th>单位地址</th>
                        <td colspan="3" style="text-align: left">{{jtqiyeInfo.address}}</td>
                    </tr>
                    <tr>
                        <th>公司简介</th>
                        <td colspan="3" style="text-align: left">{{jtqiyeInfo.companyProfile}}</td>
                    </tr>
                </tbody>
            </table>
        </div>
        <el-link v-if="!!jtqiyeInfo.corpName" type="info" :underline="false">*此数据来全国公路建设市场信用信息管理系统官方网站</el-link>
        <el-empty v-if="!jtqiyeInfo.corpName" description="暂无数据"></el-empty>
    </div>
</template>

<script>
export default {
    props: {
        jiaotongComId: {
            type: String,
            default: "",
        },
        corpType: {
            type: String,
            default: "",
        },
        navName: {
            type: String,
            default: "",
        },
    },
    data: () => ({
        jtqiyeInfo: {},
    }),
    watch:{
        jiaotongComId:{
            handler(n,o){
                this.getJTqiyeInfo();
            },
            deep:true,
        }
    },
    methods: {
        //获取交通，企业信息
        getJTqiyeInfo() {
            var that = this;
            if(!that.jiaotongComId){return}
            this.$ajax({
                type: "get",
                url: `${that.$store.state.api.searchUrl}/searchjiaotong/jiaotong/qiyeinfo`,
                data: {
                    comId: that.jiaotongComId,
                },
                callback: function (data, res) {
                    if(data.data){
                        that.jtqiyeInfo = data.data;
                        this.$emit('pushValidNames',this.navName);
                    }
                },
            });
        },
    },
    mounted() {
        this.getJTqiyeInfo();
    },
};
</script>

<style scoped lang="scss">
.data-content {
    .datas_tab {
        display: flex;
        float: none;
        margin-left: 8px;
        margin-bottom: 4px;
        .li {
            display: block;
            float: left;
            margin-left: 8px;
            font-size: 14px;
            height: 29px;
            line-height: 29px;
            padding: 0px 2px;
            cursor: pointer;
            .val{
                font-style: italic;
                color: #348bda;
            }
        }
        .active{
            color: #fff;
            background: #348bda;
            text-decoration: none;
        }
    }
    // border-bottom: 1px solid #efefef;
    padding: 20px 15px;
    .layui-table {
        width: 100%;
        border-collapse: collapse;
    }
    .layui-table td,
    .layui-table th {
        padding: 12px 10px;
        text-align: center;
        border: 1px solid #ddd;
        font-size: 15px;
    }
    .layui-table tr th {
        background: #f9f9f9;
        color: #333;
        position: inherit;
    }
}
</style>
